package com.lz.app.demo.configuration;

import com.lz.app.demo.interceptor.SecurityInterceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Title: WebMvcConfigurerAdapter
 * @ProjectName app-service
 * @Author huchao
 * @Date 2018/9/5上午9:52
 */
@Configuration
public class TokenFilterConfig extends WebMvcConfigurerAdapter {

	@Bean
	public SecurityInterceptor securityInterceptor() {
		return new SecurityInterceptor();
	}

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(securityInterceptor()).excludePathPatterns("/static/*")
				.excludePathPatterns("/error").addPathPatterns("/**");
	}

}
